package main

import (
	"github.com/vsafonkin/crud/api"
	"github.com/vsafonkin/crud/db"
	"github.com/vsafonkin/crud/model"
)

func main() {
	conn, err := db.NewPostgresConnect(db.DBConfig{
		Host:    "localhost",
		Port:    "5432",
		User:    "postgres",
		Pass:    "admin",
		DBName:  "demo",
		AppName: "goapp",
	})
	if err != nil {
		panic(err)
	}

	models := api.Models{
		Crud: model.NewCrudModel(conn),
	}

	if err := api.RunEchoServer(models); err != nil {
		panic(err)
	}
}
